/*
 * Copyright (c) 2013, FPX and/or its affiliates. All rights reserved.
 * Use, Copy is subject to authorized license.
 */
package com.fpx.xms.api.base.model;

import org.apache.commons.lang3.StringUtils;

/**
 * @author yepeng
 * @date 2015年7月22日
 */
public enum OrderLifecycleActionEnum {
    CREATE("CJ", "创建并预报"),
    //PREADVICE("YB", "预报"), 因创建状态的订单无需关系，从客户确认提交预报起关心订单状态变化
    PICKUP("LS", "揽收"),
    CHECKIN("QR", "签入"), 
    SCAN("ZC", "装车扫描"),
    CHECKOUT("QC", "签出"),
    DELIVERY("JH", "交航"), 
    ONLINE("SW", "上网"),
    DESTINATION("DC", "目的国"), 
    FOR_DELIVERY("FD", "待派送"), 
    DELIVERED("OK", "签收");
    
    private String action;
    private String desc;

    private OrderLifecycleActionEnum(String action, String desc) {
        this.action = action;
        this.desc = desc;
    }

    public static OrderLifecycleActionEnum get(String action) {
        for (OrderLifecycleActionEnum action2 : OrderLifecycleActionEnum.values()) {
            if (StringUtils.equals(action, action2.getAction())) {
                return action2;
            }
        }
        return null;
    }
    
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
